#include "statusled.h"
#include "ui_statusled.h"
#include <QCheckBox>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QPushButton>
#define COLUMN_SPACING 20

Statusled::Statusled(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Statusled)
{
   SetMainBacklight();

   ui->setupUi(this);
   ycapi = new Ycapi();
}
void Statusled::SetMainBacklight()
{
    QPalette bgpal = palette();
    bgpal.setColor (QPalette::Background, QColor (0, 0 , 0, 255));
    bgpal.setColor (QPalette::Foreground, QColor (255,0,0,255));
    setPalette (bgpal);
}

Statusled::~Statusled()
{
    delete ui;
}

void Statusled::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
void Statusled::on_ledOn_clicked()
{
    ycapi->SetLed(true);
}

void Statusled::on_LedOff_clicked()
{
    ycapi->SetLed(false);
}

void Statusled::on_close_clicked()
{
    this->close();
}

